
import 'package:flutter_app/getx/user.dart';
import 'package:get/state_manager.dart';

class Controller extends GetxController{
  var count = 0.obs;
  var isShowButton = false.obs;//是否显示按钮
  var items =[].obs;
  var userName ="".obs;
  var user =User().obs;
  increment() => count++;
  changeButtonStatus() => isShowButton.value = isShowButton.value?false:true;
  inputName(String name)=>userName.value = name;
  changeUserInfo({String name = "",int age = 0}){
    user.value.name = name;
    user.value.age = age;
  }

  @override
  void onInit() {
    print("controller初始化");
  }
}